home *** CD-ROM | disk | FTP | other *** search
- /* a t e x i t
- *
- * Lodge an exit handler. The handler is lodged within a list of exit
- * handlers to be called by exit prior to calling _exit. The list
- * is of finite length. exit will call the exits handlers in fifo
- * order. The routine returns zero on failure (list overflow) and
- * non-zero on success.
- *
- * Patchlevel 1.1
- *
- * Edit History:
- * 06-Sep-1989 Added lint control.
- * 05-Sep-1989 Created.
- */
-
- #include "stdiolib.h"
-
- /*LINTLIBRARY*/
-
- extern void (**_exit_hp)(); /* exit handler pointer */
-
- int atexit(fp)
-
- #ifdef __STDC__
- void (*fp)(void); /* exit handler */
- #else
- void (*fp)(); /* exit handler */
- #endif
- {
- return (*_exit_hp != 0) ? 0 : (*_exit_hp-- = fp, 1);
- }
-